package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.web.exception.RequestIllegalException;
import com.frogs.system.web.api.request.Request;

public class UserBaseInfoQueryRequest extends Request {
	
	private int uid;
	
	public int getUid() {
		return uid;
	}

	public void setUid(int uid) {
		this.uid = uid;
	}

	public UserBaseInfoQueryRequest() {
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		this.uid = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), 0);
		if(0 == uid) {
			throw new RequestIllegalException("缺少用户id！");
		}
	}
	
}
